<template>
  <div class="container">
    <signature :propVisible="visible" @cancel="handleCancelSign" @confirm="confirm" />
    <img :src="image"/>
    <van-button plain block type="primary" @click="open" >打开签名</van-button>
    <page :propPages="5" :propCurrent="current" @page-click="handlePageClick"/>
  </div>
</template>

<script>
import Signature from '@/components/Signature.vue'
import Page from '@/components/Page.vue'

export default {
  data() {
    return {
      visible: false,
      image: '',
      current: 0
    }
  },
  mounted() {

  },

  methods: {
    open() {
      this.visible = true
    },
    confirm(image) {
      this.image = image
      this.visible = false
    },
    handlePageClick(index) {
      this.current = index
    },
    handleCancelSign() {
      this.visible = false
    }
  },
  components: {
    Signature, Page
  },
  watch: {
  }

}
</script>

<style lang="scss" scoped>
  .container {
    width: 100%;
  }
</style>
